package com.zr.task.controller;


import java.util.List;
import javax.annotation.Resource;
import javax.annotation.security.PermitAll;
import com.zr.common.core.domain.AjaxResult;
import com.zr.task.domain.EimTaskCommandSchedule;
import com.zr.task.service.IEimTaskCommandScheduleService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestMapping;


/**
 * 任务Controller
 *
 * @author zhaojunqi
 * @date 2022-10-24
 */
@RestController
@RequestMapping("/eim/task")
public class EimTaskController {

    @Resource
    private IEimTaskCommandScheduleService iEimTaskCommandScheduleService;

    /**
     * 获取工单列表
     * @param executor 执行人
     * @param status 任务状态
     * @return
     */
    @PostMapping("/list")
    @PermitAll
    public AjaxResult list(@RequestParam("executor") String executor, @RequestParam("status") String status){
        List<EimTaskCommandSchedule> eimTaskCommandScheduleList = iEimTaskCommandScheduleService.getAllListByExecutorAndStatus(executor, status);
        return AjaxResult.success(eimTaskCommandScheduleList);
    }
}
